package data_forms

import (
	"gopkg.in/go-playground/validator.v9"
	"rabbit_love/src/utils/local"
)

type GetMarkRequest struct {
	Page  int64 `query:"limit"`
	Limit int64 `query:"offset"`
}

type AddMarkRequest struct {
	Name           string          `json:"name" validate:"required"`
	Data           string          `json:"data" validate:"required"`
	OccurrenceDate local.LocalDate `json:"occurrenceDate" validate:"required"`
}

func (reg *AddMarkRequest) Validator() error {
	validate := validator.New()
	err := validate.Struct(reg)
	return err
}

type UpdMarkRequest struct {
	MarkId         int64           `json:"markId" validate:"required"`
	Name           string          `json:"name" validate:"required"`
	Data           string          `json:"data" validate:"required"`
	OccurrenceDate local.LocalDate `json:"occurrenceDate" validate:"required"`
}

func (reg *UpdMarkRequest) Validator() error {
	validate := validator.New()
	err := validate.Struct(reg)
	return err
}

type DelMarkRequest struct {
	MarkId int64 `json:"markId" validate:"required"`
}

func (reg *DelMarkRequest) Validator() error {
	validate := validator.New()
	err := validate.Struct(reg)
	return err
}
